<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>{$config.site_name}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/admin/css/index.css" media="all">
	<script type="text/javascript" src="/static/layui/layui.js"></script>
	<script type="text/javascript" src="/static/admin/js/admin.js"></script>
</head>

<body layadmin-themealias="default" class="layui-layout-body">
	<div id="LAY_app" class="layadmin-tabspage-none">
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<!-- 头部区域 -->
				<ul class="layui-nav layui-layout-left">
					<li class="layui-nav-item layadmin-flexible" lay-unselect onclick="shrink()">
						<a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
							<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
						</a>
					</li>
				</ul>
				<ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
					<li class="layui-nav-item layui-hide-xs" lay-unselect title="全屏" onclick="fullScreen()">
						<a href="javascript:;" layadmin-event="fullscreen">
							<i class="layui-icon layui-icon-screen-full"></i>
						</a>
					</li>
					<li class="layui-nav-item" lay-unselect>
						<a href="javascript:;">
							<cite>{$user.nickname}</cite>
						</a>
						<dl class="layui-nav-child">
							<dd><a href="javascript:;" onclick="menuFire('{$config.path}user/info',1)">个人中心</a></dd>
							<hr>
							<dd layadmin-event="logout" style="text-align:center;">
								<a onclick="logout()">退出</a>
							</dd>
						</dl>
					</li>
				</ul>
			</div>
			<!-- 侧边菜单 -->
			<div class="layui-side layui-side-menu">
				<div class="layui-side-scroll">
					<div class="layui-logo" lay-href="">
						<span>{$config.site_name}</span>
					</div>
					<ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu"
					lay-filter="layadmin-system-side-menu">
					{volist name="menu" id="vo"}
						<li data-name="" data-jump="" class="layui-nav-item">
							<a href="javascript:;" lay-tips="{$vo.name}" lay-direction="2">
								<i class="layui-icon layui-icons {$vo.icon}"></i>
								<cite>{$vo.name}</cite>
							</a>
							{if (isset($vo['children']) && $vo['children'])}
								<dl class="layui-nav-child">
									{volist name="vo.children" id="cvo"}
										<dd data-name="" data-jump="/">
											{if $cvo['type'] == 1}
												<a href="javascript:;" onclick="menuFire('{$config.path}{$cvo.url}',1)">
													<i class="layui-icon layui-icons"></i>{$cvo.name}
												</a>
											{elseif $cvo['type'] == 2 /}
												<a href="{$cvo.url}" target="_blank">
													<i class="layui-icon layui-icons"></i>{$cvo.name}
												</a>
											{/if}
										</dd>
									{/volist}
								</dl>
							{/if}
						</li>
				  {/volist}
				</ul>
				</div>
			</div>
			<!-- 主体内容 -->
			<div class="layui-body" id="LAY_app_body">
				<div class="layadmin-tabsbody-item layui-show">
					<div class="layui-fluid">
						<div class="layui-card">
							<iframe src="{$config.path}index/welcome" style="width:100%;height:100%;" frameborder="0" scrolling="0"></iframe>
						</div>
					</div>
				</div>
			</div>
			<!-- 辅助元素，一般用于移动设备下遮罩 -->
			<div class="layadmin-body-shade" layadmin-event="shade" onclick="shrink()"></div>
		</div>
	</div>
	<!-- 辅助元素，一般用于移动设备下遮罩 -->
	<div class="layadmin-body-shade" layadmin-event="shade"></div>
	</div>
	</div>
	<script type="text/javascript">
		layui.use(['element', 'layer', 'jquery'], function () {
			element = layui.element;
			$ = layui.jquery;
			layer = layui.layer;
			setter = layui.setter;
			resetMainHeight($("iframe"));
		});
		// 重新设置主操作页面高度
		function resetMainHeight(obj) {
			var height = parent.document.documentElement.clientHeight - 80;
			$(obj).parent('div').height(height);
		}
		// 菜单点击
		function menuFire(obj) {
			console.log(obj)
			$('iframe').attr('src', obj);
			var width = screen();
			if (width < 2) {
				shrink();
			}
		}
		// 用户退出
		function logout() {
			layer.confirm('确定要退出吗？', {
				icon: 3,
				btn: ['确定', '取消']
			}, function () {
				$.get('{$config.path}login/logout', function (res) {
					if (res.error_code == 0) {
						layer.msg(res.msg, { 'icon': 1 });
						setTimeout(function () {
							window.location.href = "{$config.path}login/index";
						}, 1000);
					} else {
						layer.msg(res.msg, { 'icon': 2 });
					}
				}, 'json').error(function (res) {
					layer.msg(res.responseJSON.msg, { 'icon': 2 });
					reloadImg();
				});
			})
		}
	</script>
</body>

</html>